package com.frkj.yuan.adapter;

import android.view.ViewGroup;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.frkj.yuan.fragment.my.CouponsJiJiangGuoQiFragment;
import com.frkj.yuan.fragment.my.CouponsLapseFragment;
import com.frkj.yuan.fragment.my.CouponsNotUsedFragment;
import com.frkj.yuan.fragment.my.UsedCouponsFragment;

import java.util.List;

/**
 * 信息说明: 优惠券适配器
 * company: 兰州丰荣信息科技有限公司
 * 创建时间: on 2022/3/7 10 ：28
 * 项目名称：yuanban
 */
public class YouhuiQuanListAdapter extends FragmentPagerAdapter {
    private List<Fragment> fmList;

    public YouhuiQuanListAdapter(FragmentManager fragmentManager, List<Fragment> list) {
        super(fragmentManager);
        fmList = list;
    }

    @Override
    public Fragment getItem(int arg0) {
        if (arg0 == 0) {
            return new CouponsNotUsedFragment();
        } else if (arg0 == 1) {
            return new CouponsJiJiangGuoQiFragment();
        } else if (arg0 == 2) {
            return new UsedCouponsFragment();
        } else if (arg0 == 3) {
            return new CouponsLapseFragment();
        }
        return null;
    }

    @Override
    public int getCount() {
        return fmList.size();
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
    }
}
